import request from "@/utils/request";

// 机构分页查询
export function pageDepartment(query) {
  return request({
    url: "/manage/department/department/page",
    method: "get",
    params: query,
  });
}

// 新增机构
export function insertDepartment(data) {
  return request({
    url: "/manage/department/department",
    method: "post",
    data,
  });
}
// 获取机构详细信息
export function getDepartment(id) {
  return request({
    url: "/manage/department/department/" + id,
    method: "get",
  });
}
// 编辑机构
export function updateDepartment(data) {
  return request({
    url: "/manage/department/department",
    method: "put",
    data,
  });
}
// 删除机构
export function deleteDepartment(id) {
  return request({
    url: "/manage/department/department/" + id,
    method: "delete",
  });
}

//查询机构的权限列表
export function depMenuTreeselect(depId) {
  return request({
    url: "/manage/department/department/depMenuTreeselect/" + depId,
    method: "get",
  });
}

// 设置机构权限菜单
export function editMenuByDep(data) {
  return request({
    url: "/manage/department/department/editMenuByDep",
    method: "put",
    data: data,
  });
}

//查询菜单权限列表
export function treeselect() {
  return request({
    url: "/system/menu/treeselect",
    method: "get",
  });
}
// 查询机构列表
export function listDepartment() {
  return request({
    url: "manage/department/department/list",
    method: "get",
  });
}
